import Axios from "axios";
import store from "@/store";
const service = Axios.create({
  baseURL:"/prod-api", // 基础地址
  timeout:"10000",
})
// 成功1  失败2
service.interceptors.request.use((config)=>{
  // 注入token
  // store.getters.token = 
  if(store.getters.token){
    config.headers.Authorization = `Bearer ${store.getters.token}`
  }
  return config
},(error)=>{
  // 失败执行promise
  return Promise.reject(error)
})
export default service